/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Estacionamento.ClassesBasicas;

import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 *
 * @author Danilo Lima
 */
@Entity
public class EntradaSaida {
    
     @Id
    @GeneratedValue
    private long id;
    @OneToOne(fetch = FetchType.LAZY)
    @Fetch(FetchMode.JOIN)
    @Cascade(CascadeType.ALL)
    private Cliente cliente;
    @OneToOne(fetch = FetchType.LAZY)
    @Fetch(FetchMode.JOIN)
    @Cascade(CascadeType.ALL)
    private Plano plano;
    private Date entrada, saida;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public Plano getPlano() {
        return plano;
    }

    public void setPlano(Plano plano) {
        this.plano = plano;
    }

    public Date getEntrada() {
        return entrada;
    }

    public void setEntrada(Date entrada) {
        this.entrada = entrada;
    }

    public Date getSaida() {
        return saida;
    }

    public void setSaida(Date saida) {
        this.saida = saida;
    }

    public EntradaSaida() {
    }

    public EntradaSaida(long id, Cliente cliente, Plano plano, Date entrada, Date saida) {
        this.id = id;
        this.cliente = cliente;
        this.plano = plano;
        this.entrada = entrada;
        this.saida = saida;
    }

  

    @Override
    public String toString() {
        return "EntradaSaida{" + "id=" + id + ", cliente=" + cliente + ", plano=" + plano + ", entrada=" + entrada + ", saida=" + saida + '}';
    }



}
